/*
 *  exceptions.h
 *  Perceel
 *
 *  Created by Nicola Gigante on 30/08/08.
 *  Copyright 2008 Nicola Gigante. All rights reserved.
 *
 */

#ifndef __EXCEPTIONS_H__
#define __EXCEPTIONS_H__

#include <QObject>

class Exception : QObject
{
	Q_OBJECT
	
	QString m_message;
public:
	Exception() {}
	Exception(const QString &message) : m_message(message) {};
	
	void setMessage(const QString &message) { m_message = message; }
	QString message() { return m_message; }
};

class IOError : public Exception
{
	Q_OBJECT
public:
	enum IOErrorType
	{
		Open,
		Save,
		Parse
	};
private:
	IOErrorType m_type;
	
public:
	IOError() {}
	IOError(IOErrorType type, QString message) : Exception(message), m_type(type) {}
};

#endif


